package leetcode.linkedlist;

import java.util.ArrayList;
import java.util.List;

import leetcode.linkedlist.model.ListNode;

public class ConvertToArray {
    public static List<Integer> fromSingleLinked(ListNode head) {
        List<Integer> arr = new ArrayList<>();
        ListNode cur = head;
        while(cur != null) {
            arr.add(cur.val);
            cur = cur.next;
        }
        return arr;
    }
    
}
